package net.vanchu.mortgagecalculator.mortgage.calculate.single;

import net.vanchu.mortgagecalculator.common.commonView.component.WritingOptionLayout;
import net.vanchu.mortgagecalculator.common.config.LoanRate;
import net.vanchu.mortgagecalculator.common.config.LoanWay;

/**
 * Choose LoanWay : ViewClick --> PopupWindow --> Presenter do sth on Model --> Back to View
 * Choose LoanYear : ViewClick --> PopupWindow --> Presenter do sth on Model --> Back to View
 * Input text --> textInputListener --> Presenter do sth on Model --> Back to View
 * Choose LoanRates : ViewClick --> PopupWindow --> Presenter do sth on Model --> Back to View
 * <p/>
 * Created by Granton on 2016/12/21.
 */
public interface CalSingleLoanContract {

    interface Presenter {
        void chooseLoanWay(LoanWay loanWay);

        void preChooseLoanWay();

        void chooseLoanYear(int year);

        void preChooseLoanYear();

        void chooseLoanRates(LoanRate loanRate, float discount);

        void preChooseLoanRates();

        void applyCalculate();

        WritingOptionLayout.InputStateListener asInputStateListener();

        WritingOptionLayout.InputValidator asInputValidator();
    }

    interface View {
        void showLoanWay(String loansWayExpress);

        void showLoanYear(String yearExpress);

        void showLoanRate(String rateExpress);

        void showEnableButton();

        void showDisableButton();

        void showLoanWays();

        void showLoanYears();

        void showLoanRates();

        void tipError(String s);

        void resetLoanRates();

        void resetLoanYears();
    }

}